Skip to content

Conversation

fusmanii
Copy link
Contributor

@fusmanii fusmanii commented Sep 3, 2025

Using the generated constants.json in foundry scripts

Resolves https://linear.app/uma/issue/ACX-4371/fully-generate-contract-configs-constants-from-constants-exports

See #1102 first which has the script
and then #1105 which generates the constants.json file

@fusmanii fusmanii force-pushed the faisal/generate-constants-json branch from 98dcbfa to e78b1e9 Compare September 3, 2025 02:00
@fusmanii fusmanii marked this pull request as ready for review September 4, 2025 14:05
}

// Helper function to extract USDC addresses
function extractUsdcAddresses(): { [key: string]: string } {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two questions for this entire file:

  1. Why are we setting the keys as the chain name? I would think it's a lot easier for foundry to know the network's chainId over the name of the network itself?
  2. Maybe a stupid question, but these functions seem really complex for what they are doing. Why can't we just call JSON.stringify(USDC) and similar things for all of these other functions? I think adding this much code to just extract values from a map makes the script itself pretty rigid/hard to maintain.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I updated the scripts to fetch by chainid instead 4677066

make every a lot cleaner

@fusmanii fusmanii force-pushed the faisal/generate-constants-json branch from 56f1e0f to ae04d5f Compare September 5, 2025 14:57
Copy link

socket-security bot commented Sep 5, 2025

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

Copy link

linear bot commented Sep 9, 2025

@fusmanii fusmanii force-pushed the faisal/generate-constants-json branch from db95804 to 517c64b Compare September 9, 2025 15:28
@fusmanii fusmanii requested review from pxrl and bmzig September 9, 2025 15:35
@fusmanii fusmanii changed the base branch from master to faisal/generate-constants-json-script September 10, 2025 16:49
@fusmanii fusmanii force-pushed the faisal/generate-constants-json branch 3 times, most recently from a689cd4 to 61301b7 Compare September 12, 2025 15:56
Base automatically changed from faisal/generate-constants-json-script to master September 12, 2025 16:13
@fusmanii fusmanii force-pushed the faisal/generate-constants-json branch from 61301b7 to 7343ab1 Compare September 12, 2025 16:17
Signed-off-by: Faisal Usmani <[email protected]>
@fusmanii fusmanii force-pushed the faisal/generate-constants-json branch from 1558e42 to 1e7ae2b Compare September 12, 2025 16:36
@fusmanii fusmanii changed the title feat: Generated the constants file feat: Update constants.json usage Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants